package com.ruoyi.wx.mapper;

import com.ruoyi.wx.domain.PtScore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author moxiu
 * @since 2021-11-13
 */
public interface PtScoreMapper extends BaseMapper<PtScore> {

	/**
	 * 通过学生id 和 实验id 查询当前成绩表
	 * @param userId 学生id
	 * @param expId  实验id
	 * @return 成绩
	 */
	@Select("SELECT * FROM pt_score s WHERE s.exp_id = #{expId} AND s.stu_id = #{userId} ")
    PtScore selectExist(@Param("userId") Long userId,@Param("expId") Long expId);


	/**
	 * 返回josn字符串
	 * @param userId 学生id
	 * @param expId 实验id
	 * @return 观看集合集合
	 */
	@Select("SELECT video_list FROM pt_score WHERE stu_id = #{userId} AND exp_id = #{expId}")
    String selectVideoList(@Param("userId") Long userId,@Param("expId")Long expId);
}
